package com.mspbots.ticketai.graderule;


import com.mspbots.ticketai.model.Ticket;
import com.mspbots.ticketai.model.TicketRule;
import reactor.core.publisher.Mono;

/**
 * com.mspbots.core.ticketai.TicketRuleInterceptor
 *
 * @author Alex bob(https://github.com/vnobo)
 * @date Created by 2019/8/20
 */
public interface GradeRuleInterceptor {

    /**
     * prepare rule params
     *
     * @param params init grade rule params
     */
    void prepare(TicketRule params);


    /**
     * by ticket grade default 0;
     *
     * @param ticket this ticket
     */
    default void process(Ticket ticket) {
    }

    ;

    /**
     * by ticket grade default mono;
     *
     * @param ticket this ticket
     * @return default ticket
     */
    default Mono<Ticket> syncProcess(Ticket ticket) {
        return Mono.just(ticket);
    }
}
